package com.liuyucheng.idea_springboot.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class UserRegistrationListener implements ApplicationListener<UserRegisteredEvent> {

    @Override
    public void onApplicationEvent(UserRegisteredEvent event) {
        log.info("用户注册成功，发送欢迎邮件给: {}", event.getUsername());
        // 这里可以添加发送邮件的逻辑
    }
}